package yuxi.zy2;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.util.List;

public class demo {
    public static void main(String[] args) throws Exception {
        SAXReader reader = new SAXReader();
        Document read = reader.read("src\\yuxi/zy2/cars.xml");
        Element root = read.getRootElement();
        List<Element> value = root.elements("VALUE");
        for (Element value1 : value) {
            System.out.println("车牌号码："+value1.element("NO").attributeValue("DATE"));
            System.out.println("车主地址："+value1.elementText("ADDR"));
        }
    }
}
